package r6.powtorka;

import java.text.DateFormat;
import java.util.Arrays;
import java.util.Date;

public class TablicaDat {

	public void licz() {
		final int[] counter = new int[1];
		Date[] dates = new Date[100];
		for (int i = 0; i < dates.length; i++) {
			dates[i] = new Date() {
				private static final long serialVersionUID = -865652360010063231L;

				@Override
				public int compareTo(Date otherDate){
					counter[0]++;
					return super.compareTo(otherDate);
				}
			};
		}

		Arrays.sort(dates);

		for (Date e : dates)
			System.out.println(DateFormat.getTimeInstance().format(e));
		System.out.println();
		System.out.println(counter[0]);
	}
}
